/*
 * Rook.cpp
 *
 *  Created on: Mar 6, 2011
 *      Author: Michael Ziminsky
 */

#include "Rook.h"

namespace model
{
	namespace piece
	{
		Rook::Rook(bool light) : ChessPiece(light) {}

		globals::moveSet Rook::getPotentialMoves(const ChessBoard& b) const
		{
			globals::moveSet moves(new globals::moveSet::element_type);
			if (currLoc)
                for (int d = LEFT; d <= DOWN; d++)
					for (int dist = 1; cellCheck(b, getOffsetLocation(static_cast<Direction>(d), *currLoc, dist), moves); dist++);
			return moves;
		}
	} // namespace pieces
} // namespace model
